/**
 * This class is the main view for the application. It is specified in app.js as the
 * "autoCreateViewport" property. That setting automatically applies the "viewport"
 * plugin to promote that instance of this class to the body element.
 *
 * TODO - Replace this content of this view to suite the needs of your application.
 */
Ext.define('app.view.main.Main', {
    extend: 'Ext.container.Container',
    requires: [
        'app.view.main.MainController',
        'app.view.main.MainModel'
    ],
	
	uses: [ //List of optional classes to load together with this class
        'app.view.main.region.Top',
        'app.view.main.region.Bottom',
        'app.view.main.region.Left',
        'app.view.main.region.Center',
        
        'app.view.main.menu.MainMenuToolbar'
	],

    xtype: 'app-main',
    
    controller: 'main',
    
    viewModel: {
        type: 'main'
    },
	
	initComponent : function() {
		Ext.setGlyphFontFamily('FontAwesome'); // 设置图标字体文件，只有设置了以后才能用glyph属性
		this.callParent();
	},

	listeners : {
		resize : function(container) { //界面的大小发生变化的时候会触发此事件
			container.getController().onMainResize();
		}
	},
	
    layout: {
        type: 'border'
    },

    items: [{
    	xtype: 'maintop',
    	region: 'north'
    }, {
    	xtype: 'mainmenutoolbar',
    	region: 'north',
    	hidden : true,
		bind : {
			hidden : '{!isToolbarMenu}'
		}
    }, {
    	xtype: 'mainbottom',
    	region: 'south'
    }, {
        xtype: 'leftregion',
        region: 'west',
        width: 220,
        title : '导航菜单',
        collapsible : true,
		split : true,
		hidden : true,
		bind : {
			hidden : '{!isTreeMenu}'
		}
    }, {
        region: 'center',
        xtype: 'maincenter'
    }]
});
